package com.parking.carsystem.parkingchargesystem.module;

import android.os.Parcel;
import android.os.Parcelable;

public class SelfServicePaymentModule implements Parcelable {

    /**
     * msg : 操作成功
     * code : 200
     * data : {"couponFee":0,"orderNo":"60497dde531b4a5c8957ec000ef1f3f7","calcPeriod":"163天2小时55分钟","parkinglotId":126,"totalFee":1380.15,"parkinglotName":"开发区第一车场","fee":1380,"outTradeNo":"D60497dde531b4a5c_20200611142619","calcEndTime":"2020-06-11 14:26:19","paidFee":0.15,"plateNumber":"粤A99999","calcStartTime":"2019-12-31 11:30:44"}
     */

    public String msg;
    public int code;
    public DataBean data;

    protected SelfServicePaymentModule(Parcel in) {
        msg = in.readString();
        code = in.readInt();
        data = in.readParcelable(DataBean.class.getClassLoader());
    }

    public static final Creator<SelfServicePaymentModule> CREATOR = new Creator<SelfServicePaymentModule>() {
        @Override
        public SelfServicePaymentModule createFromParcel(Parcel in) {
            return new SelfServicePaymentModule(in);
        }

        @Override
        public SelfServicePaymentModule[] newArray(int size) {
            return new SelfServicePaymentModule[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(msg);
        dest.writeInt(code);
        dest.writeParcelable(data, flags);
    }

    public static class DataBean implements Parcelable{
        /**
         * couponFee : 0
         * orderNo : 60497dde531b4a5c8957ec000ef1f3f7
         * calcPeriod : 163天2小时55分钟
         * parkinglotId : 126
         * totalFee : 1380.15
         * parkinglotName : 开发区第一车场
         * fee : 1380
         * outTradeNo : D60497dde531b4a5c_20200611142619
         * calcEndTime : 2020-06-11 14:26:19
         * paidFee : 0.15
         * plateNumber : 粤A99999
         * calcStartTime : 2019-12-31 11:30:44
         */

        public double couponFee;
        public String orderNo;
        public String calcPeriod;
        public int parkinglotId;
        public double totalFee;
        public String parkinglotName;
        public double fee;
        public String outTradeNo;
        public String calcEndTime;
        public double paidFee;
        public String plateNumber;
        public String calcStartTime;

        protected DataBean(Parcel in) {
            couponFee = in.readInt();
            orderNo = in.readString();
            calcPeriod = in.readString();
            parkinglotId = in.readInt();
            totalFee = in.readDouble();
            parkinglotName = in.readString();
            fee = in.readInt();
            outTradeNo = in.readString();
            calcEndTime = in.readString();
            paidFee = in.readDouble();
            plateNumber = in.readString();
            calcStartTime = in.readString();
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel in) {
                return new DataBean(in);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeDouble(couponFee);
            dest.writeString(orderNo);
            dest.writeString(calcPeriod);
            dest.writeInt(parkinglotId);
            dest.writeDouble(totalFee);
            dest.writeString(parkinglotName);
            dest.writeDouble(fee);
            dest.writeString(outTradeNo);
            dest.writeString(calcEndTime);
            dest.writeDouble(paidFee);
            dest.writeString(plateNumber);
            dest.writeString(calcStartTime);
        }
    }
}
